package com.zhiqian.test;

import com.zhiqian.bean.HelloObject;
import com.zhiqian.rpc.NettyClient;
import com.zhiqian.service.AddService;
import com.zhiqian.service.HelloService;
import com.zhiqian.service.RpcClientProxy;

//netty测试客户端
public class NettyTestClient {
    public static void main(String[] args) {
        NettyClient client = new NettyClient("1.117.210.157");
        RpcClientProxy proxy = new RpcClientProxy(client);
        HelloService helloService = proxy.getProxy(HelloService.class);
        String result = helloService.hello(new HelloObject(200, "晚上好呀"));
        System.out.println(result);
        AddService addService = proxy.getProxy(AddService.class);
        System.out.println(addService.add(10, 20));
    }
}
